<!-- 柱状图组件 -->

<script setup lang='ts'>
import * as Echarts from "echarts"
import { onMounted } from "vue";
import optionFunc from "./option"
let option = optionFunc()
// dom对象
let chart: any
onMounted(() => {
    chart = Echarts.init(document.getElementById('histogram'));
    chart.setOption(option, true)
    window.addEventListener('resize', () => {
        chart.resize()
    })
})
</script>
 
<template>
    <div id="histogram"></div>
</template>
 
<style scoped>
#histogram {
    width: 100%;
    height: 100%;
}
</style>